﻿using System.Net.NetworkInformation;
using Avalonia.Collections;
using CommunityToolkit.Mvvm.ComponentModel;

namespace NewUI.ViewModels;

partial class WorkOrderViewModel : ViewModelBase
{
    [ObservableProperty] private string? _id;
    [ObservableProperty] private string? _number;//编号
    [ObservableProperty] private string? _package;//包装
    [ObservableProperty] private string? _packageType;//包装类型
    [ObservableProperty] private string? _diameter;//直径
    [ObservableProperty] private string? _width;//宽度
    [ObservableProperty] private string? _length;//长度
    [ObservableProperty] private string? _code;//条码
    [ObservableProperty] private string? _specification;//规格
    [ObservableProperty] private string? _displaySpecification;//显示规格
    [ObservableProperty] private string? _level;//等级
    [ObservableProperty] private string? _workstation;//工位
    [ObservableProperty] private string? _inspector;//检查员
    [ObservableProperty] private string? _printerTemplate;//打印模板

    public WorkOrderViewModel() { }

    public WorkOrderViewModel(string? id, string? number, string? package, string? packageType, string? diameter, string? width, string? length, string? code, string? specification, string? displaySpecification, string? level, string? workstation, string? inspector, string? printerTemplate)
    {
        _id = id;
        _number = number;
        _package = package;
        _packageType = packageType;
        _diameter = diameter;
        _width = width;
        _length = length;
        _code = code;
        _specification = specification;
        _displaySpecification = displaySpecification;
        _level = level;
        _workstation = workstation;
        _inspector = inspector;
        _printerTemplate = printerTemplate;
    }

    public IAvaloniaReadOnlyList<WorkOrderViewModel> Invoices
    {
        get
        {
            return new AvaloniaList<WorkOrderViewModel>()
            {
                new("1", "1001", "test1", "1test1", "", "", "", "", "", "", "", "", "", ""),
                new("2", "1002", "test2", "1test2", "", "", "", "", "", "", "", "", "", ""),
                new("3", "1003", "test3", "1test3", "", "", "", "", "", "", "", "", "", ""),
                new("4", "1004", "test4", "1test4", "", "", "", "", "", "", "", "", "", ""),
            };
        }
    }

}